package xFGE.manager
{
	import xFGE.Interface.IPanel;
	
	/**
	 * panle管理器
	 * @author Ben
	 * @version 1.0
	 * @updated 26-三月-2009 15:55:11
	 */
	public class PanelManager
	{
		private static var _myInstance:PanelManager;
		
		private var panelArray:Array = new Array();
		
		public function PanelManager()
		{
			if(_myInstance)throw (new Error("请用getinstance获取实例"));
		}
		/**
		 * 加入面板 
		 * @param panel
		 * @param name
		 * 
		 */
		public function AddPanel(panel:IPanel,name:String):void
		{
			panelArray[name] = panel;
		}
		/**
		 * 获取面板   
		 * @param name
		 * @return 
		 * 
		 */
		public function GetPanel(name:String):IPanel
		{
			return panelArray[name];
		}
		
		/**
		 * 获取instance 
		 * @return 
		 * 
		 */
		public static function GetInstance():PanelManager
		{
			if(_myInstance == null) _myInstance = new PanelManager;
			return _myInstance;
		}
	}
}